Computer systems have resources that are often shared by plural processes or threads. It is often desirable to limit access to these shared resources to one process or thread at a time. For example, a lock was historically used to provide exclusive access to a region of code or data. Under such a scenario, a process or thread would test whether a lock variable was set to the locked or unlocked state. If the test indicated the unlocked state, the process would change the variable to the locked state, and proceed into the protected resources. After completing use of the protected resource, the process would change the lock variable back to the unlocked state. While the lock variable was set to the locked state, any other process or thread would have to wait before entering the protected region. These conditional test locks require comparing (testing) the lock variable and entering the protected resource when the test indicates an unlocked state.